1 using System.Collections;
2 using
System.Collections.Generic;
3 using
UnityEngine;
4
5 public
class QuitController : MonoBehaviour {
6
7     
[SerializeField]
8     
private GameObject quitPanel;
9
10     
[SerializeField]
11     
private Animator quitPanelAnim;
12
13
14
15     
public void OpenQuitPanel()
16     {
17
18         quitPanel.SetActive(
true);
19         quitPanelAnim.Play(
"FadeIn");
20     }
21
22
23     
public void CloseQuitPanel()
24     {
25         StartCoroutine(CloseQuit());
26     }
27
28     IEnumerator CloseQuit()
29     {
30         quitPanelAnim.Play(
"FadeOut");
31         
yield return new WaitForSeconds(1f);
32         quitPanel.SetActive(
false);
33     }
34
35     
public void CloseApp()
36     {
37         Application.Quit();
38     }
39 }



Full source code giải đố hình đơn giản 16.647 lượt xem

Gõ tìm kiếm nhanh...